<?php
namespace BP\GPM;
require_once("BP/Web/WebUser.php");
class BarOfTodolist extends BarBase {
	public function getNo () 
	{
		return $this;
	}
	public function getName () 
	{
		return "待办流程";
	}
	public function getIsCanView () 
	{
		if ($WebUser->getNo()->equals("admin"))
		{
			return  TRUE ;
		}
		else
		{
			return  FALSE ;
		}
	}
	public function getTitle () 
	{
		return "待办";
	}
	public function getMore () 
	{
		return "<a href='/WF/Todolist.htm' target=_self >更多</a>";
	}
	public function getDocuments () 
	{
		$sql = (("select A.WorkID, A.FK_Flow, A.FK_Node, A.Title , A.Sender, A.RDT FROM WF_GenerWorkFlow A , WF_GenerWorkerlist B WHERE A.WorkID=B.WorkID AND B.IsPass=0 AND B.FK_Emp='" . $WebUser->getNo()) . "' ");
		$dt = DBAccess->RunSQLReturnTable($sql);
		if (($dt->Rows->size() == 0))
		{
			return "无待办工�?...";
		}
		$html = "<table>";
		$idx = 0;
		foreach ($dt->Rows as $dr) 		{
			if (($idx == 8))
			{
				break;
			}
			$fk_flow = $dr->get("FK_Flow");
			$workID = $dr->get("WorkID");
			$nodeID = $dr->get("FK_Node");
			$title = $dr->get("Title");
			$sender = $dr->get("Sender");
			$rdt = $dr->get("RDT");
			++$idx;
			$html += "<tr>";
			$html += (("<td>" . $idx) . "</td>");
			$html += (((((((("<td><a href='../../WF/MyFlow.htm?FK_Flow=" . $fk_flow) . "&WorkID=") . $workID) . "&FK_Node=") . $nodeID) . "&1=2'  target=_blank  >") . $title) . "</a></td>");
			$html += (("<td>" . $sender) . "</td>");
			$html += "</tr>";
		}
		$html += "</table>";
		return $html;
	}
	public function getWidth () 
	{
		return "300";
	}
	public function getHeight () 
	{
		return "200";
	}
	public function getIsLine () 
	{
		return  FALSE ;
	}
}
?>
